package Exercise;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

/**
 * Description：
 * Author: zhangc
 * Date：2017/8/3 17:05
 */
public class StringMatcher {

    public static int appearNumber(String srcText, String findText) {
        int count = 0;
        Pattern p = Pattern.compile(findText);
        Matcher m = p.matcher(srcText);
        while (m.find()) {
            count++;
        }
        return count;
    }


    public static void main(String[] args) {
        System.out.println(appearNumber("Zhang,Zhangdhdhdhzhang,zha,zhangzhzhangzhanhg".toLowerCase(), "zhang"));
        System.out.println("===========");
        System.out.println(9 / 2);
        System.out.println(9 >> 1);
    }
}
